<!DOCTYPE html>
<html>
   
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<!-- <link rel="stylesheet" th:href="@{/layui/layui.css}" />-->
 <link rel="stylesheet" th:href="@{/lay/layui/css/layui.css}" />
<link rel="stylesheet" th:href="@{/moon/css/bootstrap.css}" />
<link rel="stylesheet" th:href="@{/icon/css/font-awesome.min.css}" />
<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script th:src="@{/lay/layui/layui.js}"></script>
<script th:src="@{/moon/js/jquery.js}"></script>
<script th:src="@{/moon/js/vue.js}"></script>
<!-- <script th:src="@{/zcgui/layui/lay/modules/layer.js}"></script> -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

</head>

<body class="cor">

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 50px;">
		<div class="centered" id="woniu">蜗牛拍拍后台管理系统</div>
	</fieldset>

	<div class="layui-tab layui-tab-card" id="admin">
		<ul class="layui-tab-title">
			<li class="layui-this" id="admins">超级管理员</li>
			<li class="layui-this" id="adminss">普通管理员</li>
		</ul>

		<div class="layui-tab-content" style="height: 100px;">
			<div class="layui-tab-item layui-show">
				<form id="form1" action="">
					<div class="layui-form-item" id="usenames" style="margin-top:20px">
						<div class="layui-form-label" style="margin-top:-12px" ><font color="white"> 管理员账户：</font></div>
						<div class="layui-input-block">
							<div class="names">
								<input type="text" class="form-control form-control-sm"
									name="adminNames" id="adminNames" placeholder="请输入管理员账户" />
							</div>

						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-form-label"  style="margin-top:-12px"><font color="white"> 管理员密码：</font></div>
						
						<div class="layui-input-block">
							<div class="names">
								<input type="password" class="form-control form-control-sm"
									name="adminPasss" id="adminPasss" placeholder="请输入管理员密码" />
							</div>

						</div>
					</div>

					<div class="layui-form-item">
						<div class="layui-form-label"  style="margin-top:-12px"><font color="white"> 输入手机号：</font></div>
						
						<div class="layui-input-block">
							<div class="pass" style="float:left margin-left:19px" >
								<input type="text" class="form-control form-control-sm"
									name="adminPhone" placeholder="请输入手机号" id="mobile" />
							</div>
							<div  style="margin:-12px 250px">
								<button type="button"
									class="layui-btn layui-btn-primary layui-btn-radius"
									onclick="Verification()">获取验证码</button>
							</div>
							
						</div>
					</div>

					<div class="layui-form-label"  style="margin-top:-12px" ><font color="white"> 输入验证码：</font></div>
					<div class="layui-input-block">
						<div  class="pass">
							<input type="text" class="form-control form-control-sm" name="valideCodes"
								id="valideCodes" placeholder="请输入验证码" />
						</div>
					</div>

					<div class="layui-input-block" id="super">
						<button class="layui-btn" onclick="message()" type="button" onsubmit="return false" >登录</button>
						<button type="reset" class="layui-btn layui-btn-primary">刷新</button>
					</div>
				</form>
			</div>

			<!-- 普通管理员 -->
			<div class="layui-tab-item" >
				<form id="form2">
					<div class="layui-form-item" id="usenames" style="margin-top:20px">
						<font color="red"><span id="mess02"  style="text-align:center;display:block;"></span></font>			
						<div class="layui-form-label" style="margin-top:-12px"><font color="white"> 管理员账户：</font></div>
						<div class="layui-input-block">
							<div class="names">
								<input type="text" class="form-control form-control-sm"
									id="adminName" name="adminName" placeholder="请输入管理员账户" />
							</div>

						</div>
					</div>
					<div class="layui-form-item" style="margin-top:30px">
										<font color="red"><span id="mess03"  style="text-align:center;display:block;"></span></font>
				
						<div class="layui-form-label"style="margin-top:-12px"><font color="white"> 管理员密码：</font></div>
						<div class="layui-input-block">
							<div class="names">
								<font color="red"> <span th:text="${adminCode}"></span></font> 
								
								<input	type="password" class="form-control form-control-sm"
								name="adminPass" id="adminPass" placeholder="请输入管理员密码" />
							</div>

						</div>
					</div>
					
					
					<div class="layui-input-item"  style="margin-top:30px">
						<font color="red"><span id="mess01"  style="text-align:center;display:block;"></span></font>
					
						<div class="layui-form-label" style="margin-top:-12px"><font color="white"> 输入验证码：</font></div>
							
							<div class="layui-input-block">
								<div class="pass" style="float:left ">
									<input id="vcode" type="text"
										class="form-control form-control-sm" name="valideCode"
										placeholder="请输入验证码" /> 
								</div>
							
								<div style="margin-left:19px">
									<img th:src="@{/auction/User/defaultKaptcha}" onclick="this.src='/auction/User/defaultKaptcha'" width="96" height="30"
									alt="" /> <span><font color="white">点击图片刷新</font></span> 
								</div>
								</div>
					</div>
					<span style="float:left; padding-left:390px; display:block"><a href="/auction/Admin/adminiframe/forget">忘记密码？ </a></span>
					<div class="layui-input-block" id="logins">		
						<button class="layui-btn" onclick="goLogin()" type="button" onsubmit="return false" >登录</button>
						<button type="reset" class="layui-btn layui-btn-primary">刷新</button>
					</div>
				</form>
				
			</div>

		</div>
	</div>
</body>

<script>
	layui.use(['element','layer'], function() {
		var layer=layui.layer;
		var element=layui.element;
		//var $ = layui.jquery, element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

		//触发事件
		var active = {
			tabAdd : function() {
				//新增一个Tab项
				element.tabAdd('demo', {
					title : '新选项' + (Math.random() * 1000 | 0) //用于演示
					,
					content : '内容' + (Math.random() * 1000 | 0),
					id : new Date().getTime()
				//实际使用一般是规定好的id，这里以时间戳模拟下
				})
			},
			tabDelete : function(othis) {
				//删除指定Tab项
				element.tabDelete('demo', '44');

				othis.addClass('layui-btn-disabled');
			},
			tabChange : function() {
				//切换到指定Tab项
				element.tabChange('demo', '22'); //切换到：用户管理
			}
		};

		$('.site-demo-active').on('click', function() {
			var othis = $(this), type = othis.data('type');
			active[type] ? active[type].call(this, othis) : '';
		});

		//Hash地址的定位
		var layid = location.hash.replace(/^#test=/, '');
		element.tabChange('test', layid);

		element.on('tab(test)', function(elem) {
			location.hash = 'test=' + $(this).attr('lay-id');
		});

	});
</script>
<script type="text/javascript">
	function goLogin() {
		
		var name = $("#adminName").val();
		var pass = $("#adminPass").val();
		var vcode = $("#vcode").val();

		$.post("/auction/Admin/login", {
			adminName : name,
			adminPass : pass,
			valideCode : vcode
		}, function(data) {
			if (data == "error01") {
				alert("验证码输入错误，请检查后重新输入！");
			}if(data=="error02"){
				alert("用户、密码错误，请重新输入！")
			}if (data == "success") {
				alert("欢迎使用");
				window.location.href = "/iframe";
			}
		})
	}
</script>
   <script type="text/javascript">
	function message() {
		var name = $("#adminNames").val();
		var pass = $("#adminPasss").val();
		var valideCodes = $("#valideCodes").val();

		$.post("/auction/Admin/logins", {
			adminNames : name,
			adminPasss : pass,
			valideCodes : valideCodes
		}, function(data) {
			if (data == "error01") {
				alert("验证码输入错误，请检查后重新输入！");
				location.href = "/";
			}if(data=="error02"){
				alert("用户、密码错误，请重新输入！")
				location.href = "/";
			}if (data == "success") {
				alert("欢迎使用");
				window.location.href = "/iframe";
			}
		})

	}
</script> 

<script type="text/javascript">
<!-- 短信验证-->
	function Verification() {
		$.post("/auction/Admin/getMsg", {
			aName:  $("#adminNames").val(),
			aPass:  $("#adminPasss").val(),
			mobile : $("#mobile").val(),
		/* msg : $("#msg").val() */
		}, function(data) {
			if(data=="信息输入错误")
				alert("信息输入错误,请重新输入！")
			else
				alert("请及时查看验证码！")
		});
	}
	function ajaxpost() {
		/* layer.msg(data); */
	}
	setInterval(ajaxpost, 10000);
</script>
<style type="text/css">
#admin {
	margin-top: 450px;
	width: 660px;
	height: 400px;
	margin: 0 auto;
	width: 660px;
}

#admins {
	width: 328px;
}

#adminss {
	width: 332px;
}

.cor {
	background: url('/imgs/background3.jpg');
	background-size: 150% 150%;
}

.centered {
	text-align: center
	font-size 30px;
}

.aaa {
	margin-top: 20px;
}

#logins {
	margin-top: 50px;
margin-left:240px;
}

#super{
margin-left:240px;
	margin-top: 30px;

}
.pass{
width:180px;
height: 10px;
}
.names{
width:450px;

}


#woniu{
text-align:center;
font-size:35px;
color:white;
font-family:"宋体";
letter-spacing:8px;
}
</style>


</html>